
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class Lowmoney_Mapper extends Mapper<LongWritable, Text, Lowmoney_FlowBean, Text> {
    Lowmoney_FlowBean k = new Lowmoney_FlowBean();
    Text v = new Text();
    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        String line = value.toString();
        String[] fields = line.split("\t");
        String jd_title = fields[3];

        long require_nums = Long.parseLong(fields[6]);
        long end_date = Long.parseLong(fields[7]);
        String ass = fields[1];
        k.setEnd_date(end_date);
        k.setRequire_nums(require_nums);
        k.setAss(ass);


        v.set(jd_title);
        context.write(k,v);
    }
}